
function sleep(n)
{

var now = new Date();
//结束时间
var exitTime = now.getTime()+n;
while(true)
{
	now = new Date();
	if(now.getTime()>exitTime)
	{
		return ;
	}
}
onmessage = function(event){
	var num = event.data;
	console.log("接受到主线程发来的数据"+num)
	sleep(2000)
	var result = Math.sqrt(num)
	postMessage(result)
}